<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>系统登录</title>
</head>
<body>


<form name="itemsForm">

<div style="text-align: center;width: 100%;height: 100px;background-color: cadetblue;">
    <h3>资源展示界面</h3>
</div>
<div>
    <nav style="background-color: burlywood;height: 30px;">
        <ul style="list-style: none;">
            当前用户：${username}
            <c:if test="${username!=null}">
                <a href="${pageContext.request.contextPath}/person?username=${username}">个人中心</a>
                <a style=" float: right;" href="${pageContext.request.contextPath}/exit">退出</a>
            </c:if><br>
        </ul>
    </nav>
</div>

    <table width="100%" border=1>
        <tr>
            <%--<td>选择</td>--%>
            <td>资源ID</td>
            <td>资源链接</td>
            <td>资源分类</td>
            <td>资源关键词</td>
            <td>资源简介</td>
        </tr>
        <c:forEach items="${pubs}" var="pub">
            <tr>
                <!-- checkbook的value选项传入item.id,而传输的参数名为items_id -->
                <td>${pub.pubId}</td>
                <td><a href="${pub.resource}" target="_blank">${pub.resource}</a></td>
                <td>${pub.sourcetype}</td>
                <td>${pub.sourcead}</td>
                <td>${pub.sourcenote}</td>
                <td>
                    <c:if test="${pub.sourcetype.equals('文档资源')||pub.sourcetype.equals('图片资源')}">
                        <a href="${pageContext.request.contextPath}/downloadSour?sour=${pub.resource}&type=${pub.sourcetype}">下载资源</a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
    </table>
</form>
<div style="background-color: cadetblue;">
    <hr>
</div>
<div style="text-align: center;">
    <h4 style="color: cadetblue;">资源共享系统</h4>
</div>
</body>
</html>